package com.example.provide;

import com.example.utils.RabbitMqUtils;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DeliverCallback;

import java.io.IOException;

public class ConsumerTest {

    //队列名称
    public static final String QUEUE_NAME = "active_queue";

    public static void main(String[] args) throws IOException {

        Channel channel = RabbitMqUtils.getChannel();
        DeliverCallback deliverCallback = (consumerTag, message) -> {
            System.out.println(new String(message.getBody()));
        };
        channel.basicConsume(QUEUE_NAME, true, deliverCallback, error -> {
        });


    }
}
